// src/router/index.tsx
import { createBrowserRouter,Navigate  } from 'react-router-dom'
import LoginPage from '../pages/Login/login'
// import RegisterPage from '../pages/register/RegisterPage'
import TestAntd from '../pages/TestAntd/TestAntd' // 引入测试组件
import Layout  from './../layout/layout'
import Dashboard from '../pages/Dashboard/index'
const router = createBrowserRouter([
    {
        path: '/',
        element: <Layout />,
        children: [
          {
            index: true,
            element: <Navigate to="/dashboard" replace />,
          },
          {
            path: '/dashboard',
            element: <Dashboard />,
          },
          // {
          //   path: '/user-management',
          //   element: <UserManagement />,
          // },
          {
            path: '/test-antd',
            element: <TestAntd />,
          },
          {
            path: '*',
            element: <div>404 页面不存在</div>,
          },
         
        ],
      },
      {
        path: '/login',
        element: <LoginPage />,
      },
      // {
      //   path: '/register',
      //   element: <RegisterPage />,
      // },
      {
        path: '*',
        element: <div>404 页面不存在</div>,
      },
      {
        path: '/test-antd',
        element: <TestAntd />,
      },
])

export default router
